package model;

/**
 * @author Alexander Shidlovsky
 */
public class Location {
    private int row;
    private int column;
    private Stack stack;
    private boolean active = false;

    public Location(int row, int column) {
	this.row = row;
	this.column = column;
	stack = null;
	active = true;
    }

    public int getRow() {
	return row;
    }

    public void setRow(int row) {
	this.row = row;
    }

    public int getColumn() {
	return column;
    }

    public void setColumn(int column) {
	this.column = column;
    }

    public Stack getStack() {
	return stack;
    }

    void setStack(Stack stack) {
	this.stack = stack;
    }

    void removeStack() {
	stack = null;
    }
    
    
    
    public boolean isActive() {
		return active;
	}

    /*
     * stack should be null
     */
	public void setActive(boolean active) {
		if(stack == null)
			this.active = active;
	}

	@Override
    public String toString() {
	return "Active: "+active+" [ " + column + " ; " + row + " ] Stack: " + stack;
    }
}
